package com.luck;

import com.luck.rabbit.RabbitSend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 测试rabbitmq
 * Created by Hua wb on 2018/12/19.
 */
@Controller
public class RabbitController {
    @Autowired
    RabbitSend rabbitSend;
    @RequestMapping("/rabbit")
    @ResponseBody
    public String returnRabbit(){
        // 发送延时消息
        rabbitSend.sendMessage("HELLO,WOELD!", 10000);
        // 发送普通消息
        rabbitSend.sendMessage("HELLO,WOELD!");
        return "";
    }
}
